   {Pseudotrans - Codificador de pseudocodigo a lenguaje pascal
    Copyright (C) 2006  Alejandro Lucas Baldres, Nicolas Secreto
    Copyright (C) 2011  Alejandro Lucas Baldres

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA}

(**************************************************************)
{PROGRAMACION: ALEJANDRO LUCAS BALDRÉS                         }
{FECHA: 25/09/06                                               }
{LICENCIA: GNU/GPL                                             }
{--------------------------------------------------------------}
{Unidad de generacion de archivos				}
{Unit what generate files}
{--------------------------------------------------------------}
{COMPILADO CON FREEPASCAL                                      }
//Comment Modify: 12/10/2011
unit Archivos;

interface
procedure Genero_logs(Nro_linea:integer;Destino:String);

implementation
uses
SysUtils;
/////////////////////////////////////////////Procedimiento para generar los logs / Procedure for generate the log
procedure Genero_logs(Nro_linea:integer;Destino:String);
 begin
 //Si un parametro corresponde a --LOG genero el archivo o le agrego lineas al log 
 //If a parameter is equal to --LOG generate the file or add lines to file
 if (uppercase(ParamStr(1))='--LOG')or(uppercase(ParamStr(3))='--LOG')or(uppercase(ParamStr(4))='--LOG') Then
     begin
     assign(Output,'pseudotrans.log');
     if fileExists('pseudotrans.log') then //Si el archivo existe le agrego lineas / If the file exist add lines
	     append(Output)
	 else rewrite(Output);
     writeln(Output,'Generado el: '+DateTimeToStr(now()));
     writeln(Output,'RESULTADO');
     writeln (Output,'El codigo fuente fue generado en: '+Destino);
     writeln (Output,'-------------------------------');
     close(Output);
     end;
 end;
////////////////////////////////////////Fin de procedimientos para generar los log / End procedure for generate the log
end.
